<?php

/**
 * Interface for the DB API Layer
 **/

interface CW_DriverInterface
{
	function connect($host, $port, $user, $pass, $dbname, $debug = true);
	function query($sql);
	function returnConnectionErrorCode();
	function returnConnectionErrorMessage();
	function returnErrorCode();
	function returnErrorMessage();
	function close();
	function isConnected();
	function getAffectedRows();
	function getInsertId();
	function getServerVersion();
	function escapeString($string);
	function formatValues($value);
	function simpleInsert($columns, $table);
	function simpleDelete($table, $conditions);
	function simpleUpdate($columns, $table, $conditions = array());
	function simpleSelect($columns, $table, $conditions = array(), $limit = array(), $order = array());
	function getTableList($database);
	function getTableColumns($table);
	function getCreateTableSql($table_name);
	function checkIfFieldExists($field_name, $table_name);
	function dropTable($table_name);
	function dropField($field_name, $table_name);
	function addField($table_name, $field_name, $field_type, $default_value = '');
	function optimizeTable($table_name);
	function loadStoredQueries($path, $class);
	function callStoredQuery($class, $method, $params = array(), $return_all = false);
	function dump($tables = '', $data = true, $drop = false);
}


/**
 * Interface for the query iterator API Layer
 **/

interface CW_IteratorInterface
{
	function nextRow();
	function getColumnValue($column, $index = 0);
	function getCurrentRow();
	function getNumRows();
	function freeResult();
	function resetIndex();
}

?>